#pragma once

#include <typedef.h>

#if defined(CONFIG_TAR4ESP32)
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#endif

class Semaphore
{
public:
	Semaphore(int value);
	virtual ~Semaphore();

	int Wait(void);
	int Post(void);

private:
#if defined(CONFIG_TAR4ESP32)
	SemaphoreHandle_t m_Semaphore;
#else
	sem_t m_Semaphore;
#endif
};